package com.cskaoyan.order.service.remote;

import com.cskaoyan.mall.order.dto.CreateSeckillOrderRequest;
import com.cskaoyan.mall.order.dto.CreateSeckillOrderResponse;
import com.cskaoyan.mall.order.service.PromotionOrderService;
import com.cskaoyan.order.service.OrderCoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Kongwo
 * @description 暴露接口：创建促销订单
 * @since 2022/05/19 09:53
 */

@RestController
public class PromotionOrderServiceImpl implements PromotionOrderService {

    @Autowired
    OrderCoreService orderCoreService;

    @Override
    @RequestMapping(value = "/rpc/promotion/order",method = RequestMethod.POST)
    public CreateSeckillOrderResponse createPromoOrder(CreateSeckillOrderRequest request) {

        request.requestCheck();
        return orderCoreService.createPromoOrder(request);
    }
}
